﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TX.Framework.WindowUI.Forms;
using MainWindow.DAL;
using MainWindow.Model;
using MainWindow.Pages;
namespace MainWindow
{
    public partial class Login : MainForm
    {
        public Login()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
           
        }

        private void btn_login_Click(object sender, EventArgs e)
        {
            LoginDAL login = new LoginDAL();
            User user = new User();
            string username = txt_username.Text.Trim();
            string password = txt_password.Text.Trim();
            user.username = username;
            user.password = password;
            bool result = login.CheckUserExist(user);
            if(!result)
            {
                this.Warning("用户名或者密码错误");
                return;
            }
            else
            {
                WinForm win = new WinForm();
                win.Show();
                win.Show();
            }
        }
    }
}
